﻿<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>我的订单</title>

		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<link rel="stylesheet" href="{:_SKIN}/weixin/order_address/css/amazeui.min.css" />
		<link rel="stylesheet" href="{:_SKIN}/weixin/order_address/css/style.css" />
		<script type="text/javascript" src="{:_SKIN}/weixin/order_address/js/jquery.min.js" ></script>
	   
	</head>
	<body>
		<header data-am-widget="header" class="am-header am-header-default header">
		  <div class="am-header-left am-header-nav">
		     <a href="{:url('index')}" class="">
		       <i class="am-header-icon am-icon-angle-left"></i>
		     </a>
		  </div>
		  <h1 class="am-header-title"> <a href="#title-link" class="" style="color: #fff;">全部订单</a></h1>
		  <div class="am-header-right am-header-nav">
		     <a href="#right-link" class=""> </a>
		  </div>
	  </header>
		
	    <ul class="order-style">
	    	<li class="t0"><a href="{:url('order',['type'=>'0'])}">全部</a></li>
	    	<li class="t1"><a href="{:url('order',['type'=>'1'])}">已付款</a></li>
	    	<li class="t2"><a href="{:url('order',['type'=>'2'])}">已发货</a></li>
	    	<li class="t3"><a href="{:url('order',['type'=>'3'])}">已完成</a></li>

	    </ul>
  {empty name="list"}
   　　<img src="http://img.77wx.cn/2017/10/20/Fgqw6qrmrhtDFwQPB8_uLzDmiRQL547.jpg"  width="100%" />
  {/empty}

 {volist name="list" id="v"}
	    <div class="c-comment">
			<span class="c-comment-num">订单编号：{$v.orderid}</span>
			<span class="c-comment-suc">已付款</span>
		</div>
		<div class="c-comment-list" style="border: 0;">
			<a class="o-con" href="">
            	<div class="o-con-img"><img src="{$v.pic}"></div>
                <div class="o-con-txt">
                	<p style="height: 38px; overflow: hidden">{$v.title}</p>
                	<p class="price">￥{$v.money}</p>
                	<p>合计：￥<span id="money">{$v.money}</span></p>
                </div>
            	<div class="o-con-much"> <h4>*{$v.num}</h4></div>
            	
            </a>
            <div class="c-com-money">下单时间：{$v.paytime}</div>
		</div>
		<div class="c-com-btn">
        {switch name="v.state"}
         
        {case value="1"}
         <a id="tin-{$v.id}" onclick='ting("{$v.id}","{$v.money}")' style="background-color:{$v.state == 3 ?'red':'green'}">确认收货</a>
        <a >查看物流</a>

        <a >申请退款</a>
        {/case}


        {case value="2"}
        <a id="tin-{$v.id}" onclick='ting("{$v.id}","{$v.money}")' style="background-color:{$v.state == 3 ?'red':'green'}">确认收货</a>
        <a >查看物流</a>

        <a >申请退款</a>
        {/case}


        {case value="3"}
        <a >已完成</a>
        
        {/case}

        {case value="4"}
        <a >退款中</a>
        
        {/case}


        {case value="5"}
         <a>已退款</a>
        {/case} 
     


        {/switch}


		
			
			

		</div>
		<div class="clear"></div>
  

{/volist}
 {:layui()}
		<!-- <script>
         var layer=layui.layer;
			//current
        var type="{:input('type',0)}";
          $(".t"+type).addClass('current');

 

          function qrsh(id){
            
          layui.layer.confirm('确认收货后资金将结算到商家帐户',{icon: 3, title:false,btnAlign:'c',closeBtn:false},function(){


				  layer.msg('加载中', {
				  icon: 16
				  ,shade: 0.6
				  ,time:0
				  });

				  //$.post();

				  


          });


          }    


	    </script> -->

   <script>
   	 function ting(id,money) {
            Up(id,money);
      }
     function Up(id,money) {
            id = parseInt(id);
            money = money;
            if(confirm('确认选择收货吗？')){
            $.post('{:url('my/getgoods')}', {id: id,money: money}, function(data) {
                if (data.status) {
                    var status = $('#vip-'+id).children('td').eq(11).text();
                    if(status=="发货"){
                        $('#tin-'+id).children('td').eq(11).html('已发货');
                    }else{
                        $('#tin-'+id).children('td').eq(11).html('停用');
                        $('#tin-'+id).html('交易完成');
                        die();
                    }
                }

            });
        }
      }
   </script>




	</body>
</html>
